<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
input[type='text'] {
	background: none;
}
tr {
	text-align: center;
}
td{
	border: 1px solid black;
}
</style>
<title>查看新闻</title>
</head>
<body background="pic/ManBgroud.gif">
	<table cellpadding="10" cellspacing="0">
		<tr>
			<th>编号</th>
			<th>新闻ID</th>
			<th>标题</th>
			<th>板块</th>
			<th>发布人</th>
			<th>发布时间</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${sessionScope.news }" var="ni" varStatus="vs">
		<tr>
			<td>${vs.count}</td>
			<td>${ni.nId}</td>	
			<td><a href="addnews.jsp?flag=editNews&clickedId=${vs.count-1}">${ni.title}</a></td>	
			<td>${ni.board.bName}</td>	
			<td>${ni.admin.naName}</td>	
			<td>${ni.time}</td>	
			<td><input type="button" value="删除"/></td>	
		</tr>
		</c:forEach>
		<tr>
		<td colspan="7"><p id="pinsex" align="right"> 当前页数:[${sessionScope.currentPage}/${sessionScope.pageSum}]&nbsp;     
     <c:if test="${sessionScope.currentPage gt 1}">
     	<a  href="../index?flag=search&currentPage=1">首页</a>
        <a  href="../index?flag=search&currentPage=${sessionScope.currentPage-1}">上一页</a>
     </c:if>
     
     <c:if test="${sessionScope.currentPage lt sessionScope.pageSum}">
        <a href="../index?flag=search&currentPage=${sessionScope.currentPage+1}">下一页</a>
        <a href="../index?flag=search&currentPage=${sessionScope.pageSum}">末页</a></p>
     </c:if>       
     	</td>
		</tr>				
	</table>
</body>
</html>